<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Generating Command Help</title>
        <link rel="stylesheet" type="text/css" href="style.css" />
    </head>

    <body>
        <h1>Generating Command Help</h1>
        <!---header--->
	    <p>This section describes how to use the help compiler to generate the command help that is in this documentation and
	    also the help class source code that displays the same help.</p>
		<p>You definitely don't need to read this if you just want to use JJSched. This is only for people who would like to
		build upon the application and/or modify the source code. It is here only to fully document the whole creation process
		of the application.</p>
	    <h2>The help compiler</h2>
	    <p>Jjsched help compiler is a simple program in C++ that uses a Flex/Bison generated parser that parses a text file with
		description of various commands and other help topics. The help compiler then uses the parsed data to generate either a
		html documentation of JJSched commands or an on-line documentation that comes with the application. Every time I added
		a new command into the program, I documented it in the text file helpcompiler/help.txt and re-compiled both documentations.</p>
		<h3>Help compiler grammar</h3>
		<p>Follows a formal description of the helpcompiler grammar. When adding a new help topic, you should abide by this grammar.
		The grammar is case INsensitive.</p>
		<p>The grammar syntax is a standard context-free grammar syntax with the following extension/simplification: SOMETHING* on the
		right side of a rule means that the left side can generate an arbitrary number of non-terminals SOMETHING (even none). SOMETHING+
		is almost the same with the exception that SOMETHING has to appear at least once.
		Non-terminals are written in CAPITALS. Terminals are written in lower-case. </p>
		<h4>Starting non-terminal:</h4>
		HELP_GRAMMAR
		<h4>Rules:</h4>
		<table>
		<tr><td>Left side</td><td></td><td>Right side</td></tr>
		<tr><td>HELP_GRAMMAR </td><td><b>-&gt;</b> </td><td>TOPIC_OR_COMMAND*</td></tr>
		<tr><td>TOPIC_OR_COMMAND </td><td><b>-&gt;</b> </td><td>TOPIC | COMMAND</td></tr>
		<tr><td>TOPIC </td><td><b>-&gt;</b></td><td> &quot;topic&quot; TOPICPARAM*</td></tr>
		<tr><td>TOPICPARAM </td><td><b>-&gt;</b> </td><td>NAME | DESCRIPTION | NOTES | SEEALSO</td></tr>
		<tr><td>COMMAND </td><td><b>-&gt;</b> </td><td>&quot;command&quot; COMMANDPARAM*</td></tr>
		<tr><td>COMMANDPARAM </td><td><b>-&gt;</b> </td><td>NAME | DESCRIPTION | SYNOPSIS | VARIANT_DESCRIPTION | NOTES | SEEALSO</td></tr>
		<tr><td>NAME </td><td><b>-&gt;</b> </td><td>name simplestring</td></tr>
		<tr><td>DESCRIPTION </td><td><b>-&gt;</b> </td><td>description string</td></tr>
		<tr><td>SYNOPSIS </td><td><b>-&gt;</b> </td><td>synopsis number string</td></tr>
		<tr><td>VARIANT_DESCRIPTION </td><td><b>-&gt;</b> </td><td>description number string</td></tr>
		<tr><td>NOTES </td><td><b>-&gt;</b> </td><td>notes string</td></tr>
		<tr><td>SEEALSO </td><td><b>-&gt;</b> </td><td>seealso simplestring+</td></tr>
		</table>
		<hr />
		number = <i>An unsigned integer number</i><br />
		simplestring = <i>A string that does not contain new lines</i><br />
		string = <i>A string that can contain new lines</i><br />
	<!---footer--->
    </body>
</html>
